package com.axonactive.yolo.service.interfaces;

import java.util.List;

import com.axonactive.yolo.domain.SubscribedFlight;
import com.axonactive.yolo.dto.Flight;
import com.axonactive.yolo.dto.Parameters;
import com.axonactive.yolo.exception.SubcribedFlightNotFoundException;

public interface SubscribedFlightService 
{
	public SubscribedFlight create(SubscribedFlight subcribedFlight, int userId);
	
	public SubscribedFlight delete(int id) throws SubcribedFlightNotFoundException;
	
	public List<SubscribedFlight> findAll();
	
	
	public List<SubscribedFlight> findAvailableFlights();
	public SubscribedFlight update(SubscribedFlight subcribedFlight) throws SubcribedFlightNotFoundException;
	
	public SubscribedFlight findById(int id);
	
	public SubscribedFlight findByFlightId(String flightId);
	
	public List<SubscribedFlight> findByUserId(int id);
	
	
	/**
	 * Format information of userId, Flight and Parameters
	 * @param userId
	 * @param flight
	 * @param param
	 * @return SubcribeFlight object
	 */
	public SubscribedFlight formatFlight(int userId, Flight flight, Parameters param);
	
	/**
	 * Check if already added Subscribe flight
	 * @param subcribedFlight
	 * @return
	 */
	public boolean alreadyAddedSubscribeFlight(SubscribedFlight subcribedFlight, int id);
	
	/**
	 * Compare two subscribe flight
	 * @param s1 subcribedFlight
	 * @param s2 subcribedFlight
	 * @return true if equals
	 */
	public boolean compareTwoSubscribeFlight(SubscribedFlight s1, SubscribedFlight s2);

	public SubscribedFlight updateSubscribedFlight(SubscribedFlight subcribedFlight)  throws SubcribedFlightNotFoundException;

}
